
:root {
    /* 浅色 */
    --primary-color: #4285F4;
    --background-color: #FFFFFF;
    --text-color: #202124;
    --card-bg: #FFFFFF;
    --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    --menu-bg: #FFFFFF;
    --dimmed-bg: rgba(0, 0, 0, 0.5);
    
    /* 动画时间 */
    --menu-transition: 300ms;
    --hover-transition: 200ms;
}

[data-theme="dark"] {
    /* 深色 */
    --primary-color: #8AB4F8;
    --background-color: #202124;
    --text-color: #E8EAED;
    --card-bg: #2D2F31;
    --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    --menu-bg: #2D2F31;
    --dimmed-bg: rgba(0, 0, 0, 0.7);
}

/* 基础样式 */
body {
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color var(--menu-transition) ease;
}

/* 标题区 */
.header {
    display: flex;
    align-items: center;
    padding: 1rem;
    position: relative;
    z-index: 10;
}

.site-title {
    margin: 0 auto;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.menu-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 20;
}

.menu-icon {
    width: 24px;
    height: 24px;
}

/* 公告栏 */
.announcement-bar {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.announcement-text {
    display: inline-block;
    padding-left: 100%;
    animation: scrollAnnouncement 15s linear infinite;
}

@keyframes scrollAnnouncement {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.announcement-link {
    color: white;
    text-decoration: none;
}

/* 工具网格布局 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    transition: filter var(--menu-transition) ease;
}

.tool-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: 
        transform var(--hover-transition) ease,
        box-shadow var(--hover-transition) ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.tool-link {
    display: block;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
}

.tool-title {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.tool-desc {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 菜单 */
.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background-color: var(--menu-bg);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 30;
    transition: transform var(--menu-transition) ease;
    will-change: transform;
}

.side-menu.active {
    transform: translateX(300px);
}

.menu-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.close-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.back-icon {
    width: 24px;
    height: 24px;
}

.theme-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
}

.menu-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.menu-item {
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: background-color var(--hover-transition) ease;
}

.menu-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 菜单激活主界面效果 */
.menu-active .main-content {
    filter: blur(10px) brightness(0.1);
    pointer-events: none;
}

/* 主题切换提示 */
.theme-alert {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(51, 0, 0, 0.8); /* 透明度 */
    border: 1px solid #ff3838;
    color: #ff3838;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 1000;
    text-align: center;
    opacity: 0;
    transition: all 0.5s ease;
    top: -100px;
}

.theme-alert.show {
    top: 20px;
    opacity: 1;
}

@media (max-width: 768px) {
    .theme-alert {
        top: auto;
        bottom: -100px;
    }
    .theme-alert.show {
        top: auto;
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .theme-alert {
        width: 80%;
        white-space: normal;
    }
    .theme-alert::after {
        content: '\A';
        white-space: pre;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }
    
    .tool-title {
        font-size: 1.1rem;
    }
}

    @media (max-width: 480px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    .side-menu {
        width: 55%;
        left: 0;
        transform: translateX(-100%);
    }
    
    .side-menu.active {
        transform: translateX(0);
    }
}